package com.oop.demo06;

public class Test {
    public static void main(String[] args) {
          //类型之间的转换
        // 高                  低
        Person hh = new Student();
        Student student=(Student) hh ;
        student.go();
        //((Student)hh).go();

    }
}
/*
 Object object = new Student();
                 //Object>>String
                //Object>>Person>>Student
                //Object>>Person>>Teacher
        System.out.println(object instanceof Student);//ture
        System.out.println(object instanceof Teacher);//false
        System.out.println(object instanceof Object);//ture
        System.out.println(object instanceof Person);//ture
        System.out.println(object instanceof String);//false
        System.out.println("=============================" );
        Person person = new Teacher();
        System.out.println(person instanceof Student);//false
        System.out.println(person instanceof Teacher);//ture
        System.out.println(person instanceof Object);//ture
        System.out.println(person instanceof Person);//ture
        //System.out.println(person instanceof String);编译就报错
        System.out.println("=============================" );
        Student student = new Student();
        System.out.println(student instanceof Student);//ture
        //System.out.println(student instanceof Teacher);//编译就报错
        System.out.println(student instanceof Object);//ture
        System.out.println(student instanceof Person);//ture
        //System.out.println(person instanceof String);//  编译就报错
    }
 */